import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import AMap from 'vue-amap';
import { Loading, Empty, Panel, Uploader, Switch, Popup, Area, Grid, GridItem, Search, Toast, AddressList, Swipe, Tab, Tabs, SwipeItem, Cell, CellGroup, Image as VanImage, NavBar, PullRefresh, List, Stepper, Calendar, Field, SubmitBar, GoodsAction, GoodsActionIcon, GoodsActionButton, Checkbox, CheckboxGroup, Card, Dialog, RadioGroup, Radio, Icon, Button, Form } from 'vant';
import '../src/styles/fix.css';

import '../src/styles/ys-style.css';
import vueWechatTitle from 'vue-wechat-title';
Vue.use(vueWechatTitle);
import beforeCreate from './config/beforeCreate';
import created from './config/created';
import 'amfe-flexible'; //引入适配插件
import 'vant/lib/index.less';
import { config_json } from './utils/projectConfig';
Vue.use(AMap);
AMap.initAMapApiLoader({
	key: config_json.amap_key,
	plugin: ['AMap.Geolocation']
});

Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Toast);
Vue.use(Search);
Vue.use(AddressList);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(VanImage);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(NavBar);
Vue.use(PullRefresh);
Vue.use(List);
Vue.use(Stepper);
Vue.use(Calendar);
Vue.use(Form);
Vue.use(Field);
Vue.use(SubmitBar);
Vue.use(GoodsAction);
Vue.use(GoodsActionButton);
Vue.use(GoodsActionIcon);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(Card);
Vue.use(Dialog);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Icon);
Vue.use(Button);
Vue.use(Area);
Vue.use(Popup);
Vue.use(Switch);
Vue.use(Uploader);
Vue.use(Panel);
Vue.use(Empty);
Vue.use(Loading);

/* eslint-disable */
// 立即执行文件
require('./config/methods.js'); // 挂载实例方法
require('./config/api.js'); // 挂载api management
require('./config/filters.js'); // 注册全局过滤器
/* eslint-enable */

Vue.config.productionTip = false;
Vue.prototype.$config_json = config_json;
Vue.prototype.$bus = new Vue();

new Vue({
	router,
	beforeCreate,
	created,
	store,
	render: (h) => h(App),
}).$mount('#app');
